package modelz.ui;

import java.awt.Component;

import modelz.UpdateListener;
import modelz.Updateable;

public abstract class Peer<T extends Updateable<T>, C extends Component> implements UpdateListener<T> {

	public final T item;
	private C component;

	protected Peer(T item, C component) {
		this.item = item;
		this.component = component;
		item.addListener(this);
	}
	
	public C getComponent() {
		return component;
	}

	public void updated(T item) {
		component.repaint();
	}


}
